/**
 * 
 */
package edu.unmsm.ocaa.sisocaa.model.controller;

import java.util.ArrayList;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 * @author egosumcarlos
 * 
 */
@Controller
@Scope("session")
public class BarChartBean {
@Resource
LoginController login;
	public BarChartBean() {
	}
	private String outputtext;
	private Double[] data;
	private ArrayList<String> names = new ArrayList<String>();

	public Double[] getData() {
		switch (login.getId_reporteParam()) {
		case 2:
			data = new Double[login.getListRep2().size()];
			for (int i = 0; i < data.length; i++) {
				data[i]=login.getListRep2().get(i).getPorcTotPuntajes();
			}
			break;
		case 3:
			data = new Double[login.getListRep3().size()];
			for (int i = 0; i < data.length; i++) {
				data[i]=login.getListRep3().get(i).getPorcTotPuntajes();
			}
			break;

		default:
			break;
		}

		return data;
	}
	@PostConstruct
	public void init () {
		
	}
	public void setNames(ArrayList<String> names) {
		this.names = names;
	}
	public ArrayList<String> getNames() {
		names.add("puntajes");
		return names;
	}
	public void setOutputtext(String outputtext) {
		this.outputtext = outputtext;
	}
	public String getOutputtext() {
		return outputtext;
	}
}
